package com.lz.ovuola.util.spring.event;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;

/**
 * 事件发布
 * 
 * @author fz
 *
 */
@Component
public class EventPublisherManager implements ApplicationEventPublisherAware {

	private ApplicationEventPublisher applicationEventPublisher;

	@Override
	public void setApplicationEventPublisher(
			ApplicationEventPublisher applicationEventPublisher) {
		this.applicationEventPublisher = applicationEventPublisher;
	}

	/**
	 * 发布事件
	 * 
	 * @param event
	 */
	public void publish(ApplicationEvent event) {
		applicationEventPublisher.publishEvent(event);
	}

}
